import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts.js'

/**
 * 分页查询场景列表
 * @param {number} paramVo.pageNo
 * @param {number} paramVo.pageSize
 * @return
 */
export async function apiFindScenePageByParam(paramVo) {
  const url = ApiModulesRoutes.BASE + '/scene/findScenePageByParam'
  return await request.post(url, paramVo)
}

/**
 * @description 新建场景
 * @param {string}  sceneVo.createTime
 * @param {string}  sceneVo.dataStatusEnum
 * @param {string}  sceneVo.dataStatusName
 * @param {string}  sceneVo.describe
 * @param {string}  sceneVo.icon 背景图片文件id
 * @param {string}  sceneVo.id
 * @param {string}  sceneVo.name
 * @param {string}  sceneVo.orgCode
 * @param {string}  sceneVo.updateTime
 * @return {Promise<AxiosResponse<any>>}
 */
export async function apiAddScene(sceneVo) {
  const url = ApiModulesRoutes.BASE + '/scene/addScene'
  return await request.post(url, sceneVo)
}

/**
 * @description 更新场景
 * @param {string}  sceneVo.createTime
 * @param {string}  sceneVo.dataStatusEnum
 * @param {string}  sceneVo.dataStatusName
 * @param {string}  sceneVo.describe
 * @param {string}  sceneVo.icon 背景图片文件id
 * @param {string}  sceneVo.id
 * @param {string}  sceneVo.name
 * @param {string}  sceneVo.orgCode
 * @param {string}  sceneVo.updateTime
 * @return {Promise<AxiosResponse<any>>}
 */
export async function apiUpdateScene(sceneVo) {
  const url = ApiModulesRoutes.BASE + '/scene/updateScene'
  return await request.post(url, sceneVo)
}

/**
 *
 * @param sceneId
 */
export async function apiDelSceneById(sceneId) {
  const url = ApiModulesRoutes.BASE + '/scene/delSceneById'
  return await request.get(url, { params: { sceneId } })
}
